home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 2 (Reseller) / Apple R&P Lib Reseller v2.0.iso / 4-Fonts & Software / Demo Software / AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpP_203_Window.txt < prev    next >
Encoding:
Text File  |  1989-04-09  |  2.9 KB  |  161 lines

  1. # (decoded with TMPL 11972)
  2. { %filename% }
  3. { Created %date% %time% by AppMaker }
  4.  
  5. Unit %unitname%;
  6. Interface
  7.  
  8. Uses
  9. %If MPW%
  10.     {$Load ToolBox.dump}
  11.         MemTypes,
  12.         QuickDraw,
  13.         OSIntf,
  14.         ToolIntf,
  15.         PackIntf,
  16.     {$Load}
  17.  
  18. %end if%
  19. %If Think%
  20. {$ifc undefined Think_Pascal}
  21.     ListManager, Rom85,
  22. {$endc}
  23. %end if%
  24.     Globals,
  25.     ResourceDefs,
  26.     Scrolling,
  27.     WindowAids,
  28.     Miscellany;
  29.  
  30. {----------}
  31. Procedure Open%WindName% (fName:    Str255;
  32.                           vRefNum:    integer;
  33.                           fRefNum:    integer);
  34. Procedure Close%WindName%;
  35. Procedure MouseIn%WindName% (where:        Point;
  36.                             modifiers:    integer);
  37. Procedure TypeIn%WindName%  (ch:        char);
  38. Procedure Update%WindName%;
  39. Procedure Activate%WindName% (activate:    boolean);
  40. Procedure Resize%WindName%;
  41. Procedure Scroll%WindName%  (newValue:    integer;
  42.                              oldValue:    integer);
  43. Procedure Control%WindName% (whichControl:    ControlHandle;
  44.                              whichPart:        integer;
  45.                              where:            Point);
  46.  
  47. {----------}
  48. Implementation
  49.  
  50. %If MPW%
  51. {$D+}
  52. {$R+}
  53. {$OV+}
  54.  
  55. %end if%
  56. %If MPW%
  57. {$S %unitname%}
  58.  
  59. %end if%
  60. {----------}
  61. Procedure Open%WindName% {(fName:    Str255;
  62.                            vRefNum:    integer;
  63.                            fRefNum:    integer)};
  64. var
  65.     newWindow:        WindowPtr;
  66.     bounds:            Rect;
  67. Begin
  68.     newWindow := GetNewWindow (%WindName%ID, nil, WindowPtr (-1));
  69.     SetWTitle (newWindow, fName);
  70.     SetPort (newWindow);
  71.     SetNewInfo (newWindow);
  72.     with cur^ do begin
  73.         %MakeItems%
  74.         fileNum    := fRefNum;
  75.         volNum    := vRefNum;
  76.         dirty    := false;
  77.         filename := NewString (fName);
  78.         windowKind := W%WindName%;
  79.     end; {with}
  80.     ShowWindow (newWindow);
  81. End; {Open%WindName%}
  82.  
  83. {----------}
  84. Procedure Close%WindName%;
  85. Begin
  86.     with cur^ do begin
  87.         %DisposeItems%
  88.         DisposHandle (Handle (filename));
  89.     end; {with}
  90.     DiscardInfo (curWindow);
  91. End; {Close%WindName%}
  92.  
  93. {----------}
  94. Procedure MouseIn%WindName% {(where:        Point;
  95.                            modifiers:    integer)};
  96. var
  97.     bounds:            Rect;
  98. Begin
  99.     with cur^ do begin
  100.         %MouseInItems%
  101.     end; {with}
  102. End; {MouseIn%WindName%}
  103.  
  104. {----------}
  105. Procedure TypeIn%WindName% {(ch:        char)};
  106. Begin
  107.     with cur^ do begin
  108.         if text = nil then begin
  109.             SysBeep (1);
  110.         end else begin
  111.             TEKey (ch, text);
  112.         end;
  113.     end; {with}
  114. End; {TypeIn%WindName%}
  115.  
  116. {----------}
  117. Procedure Update%WindName%;
  118. var
  119.     bounds:            Rect;
  120. Begin
  121.     with cur^ do begin
  122.         %UpdateItems%
  123.     end; {with}
  124. End; {Update%WindName%}
  125.  
  126. {----------}
  127. Procedure Activate%WindName% {(activate:    boolean)};
  128. Begin
  129.     with cur^ do begin
  130.         %ActivateItems%
  131.     end; {with}
  132. End; {Activate%WindName%}
  133.  
  134. {----------}
  135. Procedure Resize%WindName%;
  136. Begin
  137.     with cur^ do begin
  138.     end; {with}
  139. End; {Resize%WindName%}
  140.  
  141. {----------}
  142. Procedure Scroll%WindName% {(newValue:    integer;
  143.                              oldValue:    integer)};
  144. Begin
  145.     { application-specific code to scroll window }
  146. End; {Scroll%WindName%}
  147.  
  148. {----------}
  149. Procedure Control%WindName% {(whichControl:    ControlHandle;
  150.                               whichPart:    integer;
  151.                               where:        Point)};
  152. var
  153.     bounds:            Rect;
  154. Begin
  155.     with cur^ do begin
  156.         %ControlItems%
  157.     end; {with}
  158. End; {Control%WindName%}
  159.  
  160. End. {%unitname%}
  161.